﻿using System;
using System.Diagnostics.Contracts;

namespace Isuka.Automation
{
    [Serializable]
    public class ObjectCreationException
        : Exception
    {
        public ObjectCreationException(Type type)
            : base(string.Format("{0} -- {1}", Messages.Error.E_CREATE_INSTANCE, type.Name))
        {
            Contract.Requires(type != null);
        }

        protected ObjectCreationException(
          System.Runtime.Serialization.SerializationInfo info,
          System.Runtime.Serialization.StreamingContext context)
            : base(info, context)
        { }
    }
}
